package com.tourscool.springboot.starter.redisson.config;

/**
 * @author Carlton
 */
public abstract class BaseServerConfig {
    /**
     * If pooled connection not used for a <code>timeout</code> time
     * and current connections amount bigger than minimum idle connections pool size,
     * then it will closed and removed from pool.
     * Value in milliseconds.
     */
    private int idleConnectionTimeout = 10000;
    /**
     * Ping timeout used in <code>Node.ping</code> and <code>Node.pingAll<code> operation.
     * Value in milliseconds.
     */
    private int pingTimeout = 1000;
    /**
     * Timeout during connecting to any Redis server.
     * Value in milliseconds.
     */
    private int connectTimeout = 10000;
    /**
     * Redis server response timeout. Starts to countdown when Redis command was succesfully sent.
     * Value in milliseconds.
     */
    private int timeout = 3000;
    private int retryAttempts = 3;
    private int retryInterval = 1500;
    /**
     * Password for Redis authentication. Should be null if not needed
     */
    private String password;
    /**
     * Subscriptions per Redis connection limit
     */
    private int subscriptionsPerConnection = 5;
    /**
     * Name of client connection
     */
    private String clientName;
    private boolean sslEnableEndpointIdentification = true;
    private String sslProvider = "JDK";
    private String sslTruststore;
    private String sslTruststorePassword;
    private String sslKeystore;
    private String sslKeystorePassword;
    private boolean keepAlive = true;
    private boolean tcpNoDelay = true;
    private Integer pingConnectionInterval = 60;

    public Integer getPingConnectionInterval() {
        return pingConnectionInterval;
    }

    public void setPingConnectionInterval(final Integer pingConnectionInterval) {
        this.pingConnectionInterval = pingConnectionInterval;
    }

    public int getIdleConnectionTimeout() {
        return idleConnectionTimeout;
    }

    public void setIdleConnectionTimeout(final int idleConnectionTimeout) {
        this.idleConnectionTimeout = idleConnectionTimeout;
    }

    public int getPingTimeout() {
        return pingTimeout;
    }

    public void setPingTimeout(final int pingTimeout) {
        this.pingTimeout = pingTimeout;
    }

    public int getConnectTimeout() {
        return connectTimeout;
    }

    public void setConnectTimeout(final int connectTimeout) {
        this.connectTimeout = connectTimeout;
    }

    public int getTimeout() {
        return timeout;
    }

    public void setTimeout(final int timeout) {
        this.timeout = timeout;
    }

    public int getRetryAttempts() {
        return retryAttempts;
    }

    public void setRetryAttempts(final int retryAttempts) {
        this.retryAttempts = retryAttempts;
    }

    public int getRetryInterval() {
        return retryInterval;
    }

    public void setRetryInterval(final int retryInterval) {
        this.retryInterval = retryInterval;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(final String password) {
        this.password = password;
    }

    public int getSubscriptionsPerConnection() {
        return subscriptionsPerConnection;
    }

    public void setSubscriptionsPerConnection(final int subscriptionsPerConnection) {
        this.subscriptionsPerConnection = subscriptionsPerConnection;
    }

    public String getClientName() {
        return clientName;
    }

    public void setClientName(final String clientName) {
        this.clientName = clientName;
    }

    public boolean isSslEnableEndpointIdentification() {
        return sslEnableEndpointIdentification;
    }

    public void setSslEnableEndpointIdentification(final boolean sslEnableEndpointIdentification) {
        this.sslEnableEndpointIdentification = sslEnableEndpointIdentification;
    }

    public String getSslTruststorePassword() {
        return sslTruststorePassword;
    }

    public void setSslTruststorePassword(final String sslTruststorePassword) {
        this.sslTruststorePassword = sslTruststorePassword;
    }

    public String getSslKeystore() {
        return sslKeystore;
    }

    public void setSslKeystore(final String sslKeystore) {
        this.sslKeystore = sslKeystore;
    }

    public String getSslKeystorePassword() {
        return sslKeystorePassword;
    }

    public void setSslKeystorePassword(final String sslKeystorePassword) {
        this.sslKeystorePassword = sslKeystorePassword;
    }

    public boolean isKeepAlive() {
        return keepAlive;
    }

    public void setKeepAlive(final boolean keepAlive) {
        this.keepAlive = keepAlive;
    }

    public boolean isTcpNoDelay() {
        return tcpNoDelay;
    }

    public void setTcpNoDelay(final boolean tcpNoDelay) {
        this.tcpNoDelay = tcpNoDelay;
    }

    public String getSslProvider() {
        return sslProvider;
    }

    public void setSslProvider(final String sslProvider) {
        this.sslProvider = sslProvider;
    }

    public String getSslTruststore() {
        return sslTruststore;
    }

    public void setSslTruststore(final String sslTruststore) {
        this.sslTruststore = sslTruststore;
    }
}